Securing method of data transfer and data transfer system provided therewith

ABSTRACT

A data transfer system is provided for preventing a slave device from operating erroneously or running out of control upon resuming communication after communication is interrupted due to the occurrence of abnormal circumstances such as a power failure and the like. A master device transmits a stop condition to the slave device for terminating communication and performs a power failure-processing task when abnormal circumstances such as a power failure or a momentary power failure occurs. The master device transmits a stop condition for terminating communication upon either the occurrence of abnormal circumstances or the resumption of communication subsequent to the recovery of the abnormal circumstances, and transmits a start condition for reestablishing communication after transmitting a stop condition to the slave device. The slave device terminates communication upon receipt of either stop condition and reestablishes communication upon receipt of a start condition.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a data transfer system for transferringdata by transmitting data bi-directionally between a master device and aslave device connected with each other by a bus line such as an I2C bus.

2. Description of the Related Art

Such a data transfer system using an I2C (Inter-Integrated Circuit) busconnected between a master device and a slave device is described inJapanese Laid-Open Patent Application No. 9-265436. Such a data transfersystem comprises a master device, such as a microcomputer, and aplurality of slave devices, such as a nonvolatile memory, IC, etc., thatare connected with each other by two bus lines, namely a SDA line (adata transmission line) and a SCL line (a clock transmission line).

As shown in FIG. 3, a data transfer starts when a start condition S,i.e. a start condition of data transfer, is transmitted from a masterdevice to a designated one of slave devices. The master device generatesclock signals and transfers data. When a stop condition P, i.e. a stopcondition of data transfer, is transmitted from the master device, datacommunication is stopped. Transferred data are formatted as shown inFIG. 3 (c).

In case a power failure or a momentary power failure occurs when datacommunication is made between the master device and the slave device,the operation of the master device and the slave device is stopped dueto an interruption of power supply, and the communication is suspendedjust as it is. The master device also ceases to communicate in anabnormal state such as influences of disturbances, malfunctions and thelike.

When a power failure or a momentary power failure is recovered and apower supply is reestablished, or an abnormal termination is reset tostart, the master device becomes operable. In this case, the masterdevice transmits a start condition to the slave device without takinginto account the conditions of the slave device and the communication iscommenced therebetween. When the communication cannot be commenced, sometrials are repeated.

The master device commands a termination of operation immediately inresponse to a power failure or a momentary power failure to shutdown theoperation as a power failure-processing task. The slave devices,however, do not perform such a power failure-processing task.Furthermore, there exists such a slave device that can operate with alower power supply voltage and a slave device stops to operate underquite a lower power supply voltage as compared with the master device.

Accordingly, even when the master device ceases to operate due to aninterruption of a power supply, a slave device still continues tooperate until a power supply voltage decreases to some degree. In case amomentary power failure is recovered during this period, the masterdevice starts to operate and commences communication. As the operationof a slave device is not suspended, the slave device determines thatcommunication is still continued, and the slave device does not operateto terminate communication. Consequently, it is likely that the slavedevice makes an erroneous judgment on data that is transferred by theresumed communication. Thus, there occurs such problems that data storedin the slave device are rewritten by mistake, or that the slave deviceoperates on the basis of mistaken data and finally runs out of control.

Furthermore, it is likely that the resumed communication becomesunstable due to noises caused by an interruption or recovery of a powersupply and the slave device erroneously recognizes the noises as data,and consequently the slave device operates erroneously.

A stable operation can be ensured, even in a power interruption, byadding a back-up circuit for stabilizing a power supply source. However,such a measure requires a circuit design that is suitable for a systemand increases the number of parts, which results in an increase ofmanufacturing costs.

SUMMARY OF THE INVENTION

It is, therefore, an object of the present invention to provide a datatransfer system which can make a stable communication without causingerroneous operations when a communication is resumed after suspensiondue to an abnormal state such as a power failure.

The present invention provides a data transfer system for transferringdata by communicating between a master device and a slave device. Themaster device is provided with a terminating means which transmitssignals for terminating communication to the slave device in case of asuspension of communication due to the occurrence of abnormalcircumstances, and a commencing means which transmits signals forcommencing communication, upon resuming communication, to the slavedevice after transmitting signals for terminating communication.

Abnormal circumstances may include a power failure, a momentary powerfailure, a hang-up or the like. For example, in case a power supply tothe respective devices is interrupted due to a power failure or amomentary power failure during communication, the master device, priorto conducting a power failure-processing task, transmits signals forterminating communication to the slave device, and transmits signals forcommencing communication, upon resuming communication subsequent to therecovery of the power supply, to the slave device after transmittingsignals for terminating communication.

The master device transmits signals for terminating communicationseveral times to the slave device until the communication is resumedafter the communication is suspended due to the occurrence of abnormalcircumstances.

Thus, the master device transmits signals for terminating communicationwhen communication is suspended, and further transmits signals forterminating communication prior to commencing communication. With suchan arrangement, the slave device can receive either of the above signalsfor terminating communication without fail prior to receiving signalsfor commencing communication.

In case the slave device is still in operation at the time of theoccurrence of abnormal circumstances, the slave device can receivesignals for terminating communication and terminate communicationnormally. In case the slave device is not in operation or in transit,the slave device cannot receive signals from the master device. In thiscase, the slave device becomes operable when abnormal circumstances areresolved to be normal and likely recognizes that communication is stillcontinued. As a result, the slave device operates erroneously on thebasis of mistaken data and runs out of control. The slave device,however, receives signals for terminating communication from the masterdevice as mentioned above, and then the slave device can once terminatecommunication. By receiving signals for commencing communication, theslave device can operate to communicate regularly.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing a data transfer system according tothe present invention;

FIG. 2 is a flow chart showing the operation of the master device incase of an occurrence of abnormal circumstances; and

FIG. 3 is a format at the time when an I2C bus transfers data, whereinFIG. 3( a) depicts data in a data transmission line, FIG. 3( b) depictsa clock in a clock transmission line, and FIG. 3( c) depicts a dataarray.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

One embodiment of the data transfer system according to the presentinvention is shown in FIG. 1. As in the case of a conventional systememploying an I2C bus, a master device 1 composed of a microcomputer anda plurality of slave devices 2 are connected through a data transmissionline 3 and a clock transmission line 4. This data transfer system isapplied to video equipments such as a TV, VCR, DVD and the like. Theslave devices 2 are a nonvolatile memory (E2PROM), Y/C IC, audio IC,chroma IC, switch IC and the like.

The master device 1 has a terminating function which transmits a stopcondition as signals for terminating communication to the slave devices2 in order to terminate communication at the time of the occurrence ofabnormal circumstances during communication. The master device 1 alsohas a resuming function which transmits a start condition as signals forresuming communication to the slave devices 2 after transmitting a stopcondition at the time abnormal circumstances are resolved andcommunication is resumed.

Next, the operation at the time of an occurrence of abnormalcircumstances will be explained in accordance with the accompanying FIG.2. The master device 1 detects variations of a power source voltage, anddetermines that an abnormal circumstance such as a power failure, amomentary power failure and the like occurs when the power sourcevoltage decreases below a predetermined value. Subsequently, the masterdevice 1 transmits a stop condition as I2C bus data to the slave device2 in transit, and terminates communication. Thereafter, a powerfailure-processing task is implemented to suspend operation.

Although a power supply is interrupted due to a power failure and thelike, the master device 1 receives an auxiliary power from a condenserand the like for performing a power failure-processing task.Accordingly, the master device 1 can transmit a stop condition evenafter the occurrence of a power failure and the like. A stop conditionis also transmitted to terminate communication when the master device 1is suspended due to the occurrence of some abnormal accidents.

The slave device 2 operates to suspend communication upon receipt of thestop condition, thereby ensuring that a data transfer suspended by themaster device 1 is not continued at the slave device 2.

Although a power voltage is gradually decreased due to an interruptionof power supply, the slave device 2 is operable for a certain periodafter the occurrence of a power failure since a power supply voltage forstopping the slave device 2 is considerably low. Accordingly, the slavedevice 2 can receive the stop condition from the master device 1 withinthis period.

When a power supply is resumed after resolving a power failure, themaster device 1 detects a power voltage and determines that a normalstate is recovered, and then starts to operate. In case the masterdevice 1 is suspended due to the occurrence of abnormal circumstances,the operation is resumed by inputting reset signals. After waiting for acertain period (3 to 4 seconds, for example) until the operation becomesstable, communication is resumed. A start condition is transmitted aftertransmitting a stop condition as I2C bus data to the slave device 2 withwhich communication is made before a power failure occurs. Thereafter, aregular processing is conducted. In case the master device 1 is reset,data are read out from memories before conducting a regular processing.

When receiving a stop condition one more time, the slave device 2operates to suspend communication again for enhancing certainty andsecurity. Then, communication is resumed upon receipt of a startcondition. In case the slave device 2 is arranged to detect thesuspension of communication by receiving a first stop condition, theslave device 2 can determine that communication is terminated even ifthe slave device 2 again receives a stop condition after a recovery of apower supply or a reset operation, so that the slave device 2 candisregard the stop condition and does not operate to suspend.Accordingly, in case a start condition is transmitted immediately aftera stop condition is transmitted, the slave device 2 is ready to receivetransmission and starts to communicate at once.

Due to the occurrence of an abnormal circumstance, the slave device 2cannot occasionally receive a stop condition that is transmitted beforecommunication is suspended. In this case, the slave device 2 determinesthat communication is continued after a recovery of a power supply or areset operation, and tries to operate erroneously on the basis of thedata that is transmitted before a power failure occurs. In case themaster device 1 transmits a stop condition to the slave device 2 onemore time, the slave device 2 can stop communication once upon receiptof the stop condition. The slave device 2 takes the suspended data asbeing invalid and operates on the basis of newly transferred data. Thestop condition may be used as one of reset signals, so that the slavedevice 2 erroneously operated can be reset by receiving the stopcondition to operate normally.

The present invention is not limited to the above-described specificembodiments but is subject to various changes and modifications. Forexample, the present data transfer system may be applied tocommunication using bus lines other than an I2C bus. Furthermore, incase a slave device starts slowly after a recovery of a power supply ora reset operation and cannot receive a stop condition transmitted fromthe master device, a stop condition may be transmitted several timesprior to the transmission of a start condition.

Further, signals for terminating communication, which are transmittedfrom the master device to the slave device, may be used for one of resetsignals. Also, signals for terminating communication, which aretransmitted in case of the occurrence of abnormal circumstances, may beused for a stop condition, and signals for terminating communication,which are transmitted when abnormal circumstances are resolved, may beused for one of reset signals. By such arrangements, the slave devicecan be recovered from such conditions as erroneous operations andrunning out of control to normal operating conditions.

As apparent from the above-described explanation, the slave device canbe informed without fail that the master device stops to communicate dueto the occurrence of abnormal circumstances and does not make erroneousjudgments of data, so that erroneous rewriting of data and running outof control are prevented.

As the slave device ceases to communicate without fail, the slave deviceis free of influence from noises caused by a shutdown of a power sourceor an input of power supply. Therefore, the slave device does notrecognize noises as data and operate erroneously, and as a result,communication becomes stable. A backup circuit to be used for a powerfailure is not required, but a simple software processing is onlyrequired to cope with the occurrence of abnormal circumstances, andtherefore, the manufacturing costs do not increase.

1. A data transfer system for transferring data and comprising a masterdevice operable to communicate with a slave device, wherein said masterdevice comprises: terminating means for transmitting signals forterminating communication to the slave device upon a suspension ofcommunication with the slave device due to an occurrence of abnormalcircumstances, and upon resuming the communication with the slave deviceafter recovery of the abnormal circumstances; and commencing means fortransmitting signals for commencing communication, upon resumingcommunication with the slave device, to the slave device after saidterminating means transmits the signals for terminating communicationwherein said terminating means transmits the signals for terminatingcommunication to the slave device without receiving a status signal fromthe slave device.
 2. A data transfer system for transferring data andcomprising a master device operable to communicate with a slave device,wherein said master device comprises: terminating means for transmittingsignals for terminating communication to the slave device prior toperforming a power failure-processing task upon an interruption of apower supply to the slave device during communication with the slavedevice, and upon resuming communication with the slave device after thepower supply to the slave device is restored; and commencing means fortransmitting signals for commencing communication to the slave device,upon resuming communication after the power supply to the slave deviceis recovered, after said terminating means transmits the signals forterminating communication to the slave device, wherein said terminatingmeans transmits the signals for terminating communication to the slavedevice without receiving a status signal from the slave device.
 3. Adata transfer system for transferring data and comprising a masterdevice operable to communicate with a slave device, wherein said masterdevice comprises: first terminating means for transmitting signalsseveral times for terminating communication to the slave device untilcommunication with the slave device is resumed after the communicationis suspended due to an occurrence of abnormal circumstances; and secondterminating means for transmitting signals for terminating communicationto the slave device upon resuming the communication with the slavedevice, wherein said first terminating means transmits the signals forterminating communication to the slave device without receiving a statussignal from the slave device.